package com.psycho.sys.api.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.psycho.sys.api.entity.ConsultationRecord;
import com.psycho.sys.api.vo.ConsultationRecordVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 咨询记录Mapper接口
 */
@Mapper
public interface ConsultationRecordMapper extends BaseMapper<ConsultationRecord> {
    /**
     * 查询咨询记录（包含用户和咨询师信息）
     */
    List<ConsultationRecordVO> selectRecordWithDetails(@Param("userId") Long userId,
            @Param("counselorId") Long counselorId,
            @Param("status") Integer status);

    /**
     * 分页查询咨询记录（包含用户和咨询师信息）
     */
    Page<ConsultationRecordVO> selectRecordWithDetails(Page<ConsultationRecordVO> page,
            @Param("userId") Long userId,
            @Param("counselorId") Long counselorId,
            @Param("status") Integer status);

    /**
     * 统计咨询师的评分情况
     */
    Map<String, Object> selectCounselorRatingStats(@Param("counselorId") Long counselorId);
}